Skip to main content

API Reference

The GP Build Tool public API is entirely CMake macros with the gp prefix. Each macro is a thin wrapper that delegates to an internal gpbt_ function, so internal behaviour can change without breaking project code.

Including the build tool

Every CMakeLists.txt that uses the API must include the build tool module:

include(gp-build-tool)

The module uses include_guard(GLOBAL), so including it multiple times across the source tree is safe. Subsequent includes are no-ops.

API surface

The public API is grouped by function. Each group is documented on its own page.

GroupWhat it covers
Build Tool LifecyclegpStartBuildTool, gpEndBuildTool, gpApplyGraphicalPlaygroundDefaultPolicy
ScanninggpBuildToolAutoScan
TargetsgpStartModule, gpStartExecutable, gpStartPlugin, gpEndTarget
SourcesgpAddSourceFile, gpAddSourceDirectory, gpExcludeSourceFile, and more
DependenciesgpAddDependency with PUBLIC, PRIVATE, INTERNAL, and DYNAMIC visibility
Include DirectoriesAutomatic include path management from the directory layout
Compile DefinitionsgpAddCompileDefinition
Compile OptionsgpAddCompileOption
Link OptionsgpAddLinkOption
Miscellaneous OptionsgpSetHeaderOnly, gpDisableStrictWarnings, gpSetStatic, gpAddPrecompiledHeader, and more
Executable SpecificgpSetGuiExecutable, gpSetEntryPoint, gpAddResourceFile
IDE IntegrationgpSetFolder, gpAddAlias

Naming conventions

PatternMeaning
gp<PascalCase>()Public macro, safe to call from project code
gpbt_<camelCase>()Internal function, do not call directly
GPBT_<UPPER_SNAKE>Build tool cache variable or global flag
gp::<name>CMake alias for a GP module target
gp::thirdparty::<name>CMake alias for a resolved thirdparty package
warning

Do not call gpbt_* functions directly from project code. They are internal to the build tool and their signatures can change between versions without notice.